3.127 \(\int \frac{x^2 \left (d+e x^2+f x^4+g x^6\right )}{\left (a+b x^2+c x^4\right )^2} \, dx\)

Optimal. Leaf size=471 \[ -\frac{x \left (x^2 \left (-c^2 (2 a f+b e)+b c (3 a g+b f)+b^3 (-g)+2 c^3 d\right )-a b^2 g+b c (a f+c d)-2 a c (c e-a g)\right )}{2 c^2 \left (b^2-4 a c\right ) \left (a+b x^2+c x^4\right )}-\frac{\tan ^{-1}\left (\frac{\sqrt{2} \sqrt{c} x}{\sqrt{b-\sqrt{b^2-4 a c}}}\right ) \left (\frac{b^2 c (19 a g+c e)-4 b c^2 (2 a f+c d)+4 a c^2 (c e-5 a g)-3 b^4 g+b^3 c f}{\sqrt{b^2-4 a c}}-c^2 (b e-6 a f)-b c (13 a g+b f)+3 b^3 g+2 c^3 d\right )}{2 \sqrt{2} c^{5/2} \left (b^2-4 a c\right ) \sqrt{b-\sqrt{b^2-4 a c}}}-\frac{\tan ^{-1}\left (\frac{\sqrt{2} \sqrt{c} x}{\sqrt{\sqrt{b^2-4 a c}+b}}\right ) \left (-\frac{b^2 c (19 a g+c e)-4 b c^2 (2 a f+c d)+4 a c^2 (c e-5 a g)-3 b^4 g+b^3 c f}{\sqrt{b^2-4 a c}}-c^2 (b e-6 a f)-b c (13 a g+b f)+3 b^3 g+2 c^3 d\right )}{2 \sqrt{2} c^{5/2} \left (b^2-4 a c\right ) \sqrt{\sqrt{b^2-4 a c}+b}}+\frac{g x}{c^2} \]

[Out]

(g*x)/c^2 - (x*(b*c*(c*d + a*f) - a*b^2*g - 2*a*c*(c*e - a*g) + (2*c^3*d - c^2*(
b*e + 2*a*f) - b^3*g + b*c*(b*f + 3*a*g))*x^2))/(2*c^2*(b^2 - 4*a*c)*(a + b*x^2
+ c*x^4)) - ((2*c^3*d - c^2*(b*e - 6*a*f) + 3*b^3*g - b*c*(b*f + 13*a*g) + (b^3*
c*f - 4*b*c^2*(c*d + 2*a*f) - 3*b^4*g + 4*a*c^2*(c*e - 5*a*g) + b^2*c*(c*e + 19*
a*g))/Sqrt[b^2 - 4*a*c])*ArcTan[(Sqrt[2]*Sqrt[c]*x)/Sqrt[b - Sqrt[b^2 - 4*a*c]]]
)/(2*Sqrt[2]*c^(5/2)*(b^2 - 4*a*c)*Sqrt[b - Sqrt[b^2 - 4*a*c]]) - ((2*c^3*d - c^
2*(b*e - 6*a*f) + 3*b^3*g - b*c*(b*f + 13*a*g) - (b^3*c*f - 4*b*c^2*(c*d + 2*a*f
) - 3*b^4*g + 4*a*c^2*(c*e - 5*a*g) + b^2*c*(c*e + 19*a*g))/Sqrt[b^2 - 4*a*c])*A
rcTan[(Sqrt[2]*Sqrt[c]*x)/Sqrt[b + Sqrt[b^2 - 4*a*c]]])/(2*Sqrt[2]*c^(5/2)*(b^2
- 4*a*c)*Sqrt[b + Sqrt[b^2 - 4*a*c]])

_______________________________________________________________________________________

Rubi [A]  time = 15.8233, antiderivative size = 471, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 4, integrand size = 35, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.114 \[ -\frac{x \left (x^2 \left (-c^2 (2 a f+b e)+b c (3 a g+b f)+b^3 (-g)+2 c^3 d\right )-a b^2 g+b c (a f+c d)-2 a c (c e-a g)\right )}{2 c^2 \left (b^2-4 a c\right ) \left (a+b x^2+c x^4\right )}-\frac{\tan ^{-1}\left (\frac{\sqrt{2} \sqrt{c} x}{\sqrt{b-\sqrt{b^2-4 a c}}}\right ) \left (\frac{b^2 c (19 a g+c e)-4 b c^2 (2 a f+c d)+4 a c^2 (c e-5 a g)-3 b^4 g+b^3 c f}{\sqrt{b^2-4 a c}}-c^2 (b e-6 a f)-b c (13 a g+b f)+3 b^3 g+2 c^3 d\right )}{2 \sqrt{2} c^{5/2} \left (b^2-4 a c\right ) \sqrt{b-\sqrt{b^2-4 a c}}}-\frac{\tan ^{-1}\left (\frac{\sqrt{2} \sqrt{c} x}{\sqrt{\sqrt{b^2-4 a c}+b}}\right ) \left (-\frac{b^2 c (19 a g+c e)-4 b c^2 (2 a f+c d)+4 a c^2 (c e-5 a g)-3 b^4 g+b^3 c f}{\sqrt{b^2-4 a c}}-c^2 (b e-6 a f)-b c (13 a g+b f)+3 b^3 g+2 c^3 d\right )}{2 \sqrt{2} c^{5/2} \left (b^2-4 a c\right ) \sqrt{\sqrt{b^2-4 a c}+b}}+\frac{g x}{c^2} \]

Antiderivative was successfully verified.

[In]  Int[(x^2*(d + e*x^2 + f*x^4 + g*x^6))/(a + b*x^2 + c*x^4)^2,x]

[Out]

(g*x)/c^2 - (x*(b*c*(c*d + a*f) - a*b^2*g - 2*a*c*(c*e - a*g) + (2*c^3*d - c^2*(
b*e + 2*a*f) - b^3*g + b*c*(b*f + 3*a*g))*x^2))/(2*c^2*(b^2 - 4*a*c)*(a + b*x^2
+ c*x^4)) - ((2*c^3*d - c^2*(b*e - 6*a*f) + 3*b^3*g - b*c*(b*f + 13*a*g) + (b^3*
c*f - 4*b*c^2*(c*d + 2*a*f) - 3*b^4*g + 4*a*c^2*(c*e - 5*a*g) + b^2*c*(c*e + 19*
a*g))/Sqrt[b^2 - 4*a*c])*ArcTan[(Sqrt[2]*Sqrt[c]*x)/Sqrt[b - Sqrt[b^2 - 4*a*c]]]
)/(2*Sqrt[2]*c^(5/2)*(b^2 - 4*a*c)*Sqrt[b - Sqrt[b^2 - 4*a*c]]) - ((2*c^3*d - c^
2*(b*e - 6*a*f) + 3*b^3*g - b*c*(b*f + 13*a*g) - (b^3*c*f - 4*b*c^2*(c*d + 2*a*f
) - 3*b^4*g + 4*a*c^2*(c*e - 5*a*g) + b^2*c*(c*e + 19*a*g))/Sqrt[b^2 - 4*a*c])*A
rcTan[(Sqrt[2]*Sqrt[c]*x)/Sqrt[b + Sqrt[b^2 - 4*a*c]]])/(2*Sqrt[2]*c^(5/2)*(b^2
- 4*a*c)*Sqrt[b + Sqrt[b^2 - 4*a*c]])

_______________________________________________________________________________________

Rubi in Sympy [A]  time = 168.249, size = 547, normalized size = 1.16 \[ \frac{g x}{c^{2}} + \frac{x \left (- 2 a^{2} c g + a b^{2} g - a b c f + 2 a c^{2} e - b c^{2} d + x^{2} \left (- 3 a b c g + 2 a c^{2} f + b^{3} g - b^{2} c f + b c^{2} e - 2 c^{3} d\right )\right )}{2 c^{2} \left (- 4 a c + b^{2}\right ) \left (a + b x^{2} + c x^{4}\right )} - \frac{\sqrt{2} \left (b \left (- 13 a b c g + 6 a c^{2} f + 3 b^{3} g - b^{2} c f - b c^{2} e + 2 c^{3} d\right ) - 2 c \left (- 10 a^{2} c g + 3 a b^{2} g - a b c f + 2 a c^{2} e - b c^{2} d\right ) + \sqrt{- 4 a c + b^{2}} \left (- 13 a b c g + 6 a c^{2} f + 3 b^{3} g - b^{2} c f - b c^{2} e + 2 c^{3} d\right )\right ) \operatorname{atan}{\left (\frac{\sqrt{2} \sqrt{c} x}{\sqrt{b + \sqrt{- 4 a c + b^{2}}}} \right )}}{4 c^{\frac{5}{2}} \sqrt{b + \sqrt{- 4 a c + b^{2}}} \left (- 4 a c + b^{2}\right )^{\frac{3}{2}}} + \frac{\sqrt{2} \left (b \left (- 13 a b c g + 6 a c^{2} f + 3 b^{3} g - b^{2} c f - b c^{2} e + 2 c^{3} d\right ) - 2 c \left (- 10 a^{2} c g + 3 a b^{2} g - a b c f + 2 a c^{2} e - b c^{2} d\right ) - \sqrt{- 4 a c + b^{2}} \left (- 13 a b c g + 6 a c^{2} f + 3 b^{3} g - b^{2} c f - b c^{2} e + 2 c^{3} d\right )\right ) \operatorname{atan}{\left (\frac{\sqrt{2} \sqrt{c} x}{\sqrt{b - \sqrt{- 4 a c + b^{2}}}} \right )}}{4 c^{\frac{5}{2}} \sqrt{b - \sqrt{- 4 a c + b^{2}}} \left (- 4 a c + b^{2}\right )^{\frac{3}{2}}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate(x**2*(g*x**6+f*x**4+e*x**2+d)/(c*x**4+b*x**2+a)**2,x)

[Out]

g*x/c**2 + x*(-2*a**2*c*g + a*b**2*g - a*b*c*f + 2*a*c**2*e - b*c**2*d + x**2*(-
3*a*b*c*g + 2*a*c**2*f + b**3*g - b**2*c*f + b*c**2*e - 2*c**3*d))/(2*c**2*(-4*a
*c + b**2)*(a + b*x**2 + c*x**4)) - sqrt(2)*(b*(-13*a*b*c*g + 6*a*c**2*f + 3*b**
3*g - b**2*c*f - b*c**2*e + 2*c**3*d) - 2*c*(-10*a**2*c*g + 3*a*b**2*g - a*b*c*f
 + 2*a*c**2*e - b*c**2*d) + sqrt(-4*a*c + b**2)*(-13*a*b*c*g + 6*a*c**2*f + 3*b*
*3*g - b**2*c*f - b*c**2*e + 2*c**3*d))*atan(sqrt(2)*sqrt(c)*x/sqrt(b + sqrt(-4*
a*c + b**2)))/(4*c**(5/2)*sqrt(b + sqrt(-4*a*c + b**2))*(-4*a*c + b**2)**(3/2))
+ sqrt(2)*(b*(-13*a*b*c*g + 6*a*c**2*f + 3*b**3*g - b**2*c*f - b*c**2*e + 2*c**3
*d) - 2*c*(-10*a**2*c*g + 3*a*b**2*g - a*b*c*f + 2*a*c**2*e - b*c**2*d) - sqrt(-
4*a*c + b**2)*(-13*a*b*c*g + 6*a*c**2*f + 3*b**3*g - b**2*c*f - b*c**2*e + 2*c**
3*d))*atan(sqrt(2)*sqrt(c)*x/sqrt(b - sqrt(-4*a*c + b**2)))/(4*c**(5/2)*sqrt(b -
 sqrt(-4*a*c + b**2))*(-4*a*c + b**2)**(3/2))

_______________________________________________________________________________________

Mathematica [A]  time = 4.39267, size = 575, normalized size = 1.22 \[ \frac{-\frac{2 \sqrt{c} x \left (2 c \left (a^2 g-a c \left (e+f x^2\right )+c^2 d x^2\right )+b^2 \left (c f x^2-a g\right )+b c \left (a \left (f+3 g x^2\right )+c \left (d-e x^2\right )\right )+b^3 (-g) x^2\right )}{\left (b^2-4 a c\right ) \left (a+b x^2+c x^4\right )}-\frac{\sqrt{2} \tan ^{-1}\left (\frac{\sqrt{2} \sqrt{c} x}{\sqrt{b-\sqrt{b^2-4 a c}}}\right ) \left (2 c^2 \left (-10 a^2 g+c d \sqrt{b^2-4 a c}+3 a f \sqrt{b^2-4 a c}+2 a c e\right )-b c \left (c e \sqrt{b^2-4 a c}+13 a g \sqrt{b^2-4 a c}+8 a c f+4 c^2 d\right )+b^2 c \left (-f \sqrt{b^2-4 a c}+19 a g+c e\right )+b^3 \left (3 g \sqrt{b^2-4 a c}+c f\right )-3 b^4 g\right )}{\left (b^2-4 a c\right )^{3/2} \sqrt{b-\sqrt{b^2-4 a c}}}-\frac{\sqrt{2} \tan ^{-1}\left (\frac{\sqrt{2} \sqrt{c} x}{\sqrt{\sqrt{b^2-4 a c}+b}}\right ) \left (2 c^2 \left (10 a^2 g+c d \sqrt{b^2-4 a c}+3 a f \sqrt{b^2-4 a c}-2 a c e\right )+b c \left (-c e \sqrt{b^2-4 a c}-13 a g \sqrt{b^2-4 a c}+8 a c f+4 c^2 d\right )-b^2 c \left (f \sqrt{b^2-4 a c}+19 a g+c e\right )+b^3 \left (3 g \sqrt{b^2-4 a c}-c f\right )+3 b^4 g\right )}{\left (b^2-4 a c\right )^{3/2} \sqrt{\sqrt{b^2-4 a c}+b}}+4 \sqrt{c} g x}{4 c^{5/2}} \]

Antiderivative was successfully verified.

[In]  Integrate[(x^2*(d + e*x^2 + f*x^4 + g*x^6))/(a + b*x^2 + c*x^4)^2,x]

[Out]

(4*Sqrt[c]*g*x - (2*Sqrt[c]*x*(-(b^3*g*x^2) + b^2*(-(a*g) + c*f*x^2) + 2*c*(a^2*
g + c^2*d*x^2 - a*c*(e + f*x^2)) + b*c*(c*(d - e*x^2) + a*(f + 3*g*x^2))))/((b^2
 - 4*a*c)*(a + b*x^2 + c*x^4)) - (Sqrt[2]*(-3*b^4*g + b^2*c*(c*e - Sqrt[b^2 - 4*
a*c]*f + 19*a*g) + 2*c^2*(c*Sqrt[b^2 - 4*a*c]*d + 2*a*c*e + 3*a*Sqrt[b^2 - 4*a*c
]*f - 10*a^2*g) + b^3*(c*f + 3*Sqrt[b^2 - 4*a*c]*g) - b*c*(4*c^2*d + c*Sqrt[b^2
- 4*a*c]*e + 8*a*c*f + 13*a*Sqrt[b^2 - 4*a*c]*g))*ArcTan[(Sqrt[2]*Sqrt[c]*x)/Sqr
t[b - Sqrt[b^2 - 4*a*c]]])/((b^2 - 4*a*c)^(3/2)*Sqrt[b - Sqrt[b^2 - 4*a*c]]) - (
Sqrt[2]*(3*b^4*g - b^2*c*(c*e + Sqrt[b^2 - 4*a*c]*f + 19*a*g) + 2*c^2*(c*Sqrt[b^
2 - 4*a*c]*d - 2*a*c*e + 3*a*Sqrt[b^2 - 4*a*c]*f + 10*a^2*g) + b^3*(-(c*f) + 3*S
qrt[b^2 - 4*a*c]*g) + b*c*(4*c^2*d - c*Sqrt[b^2 - 4*a*c]*e + 8*a*c*f - 13*a*Sqrt
[b^2 - 4*a*c]*g))*ArcTan[(Sqrt[2]*Sqrt[c]*x)/Sqrt[b + Sqrt[b^2 - 4*a*c]]])/((b^2
 - 4*a*c)^(3/2)*Sqrt[b + Sqrt[b^2 - 4*a*c]]))/(4*c^(5/2))

_______________________________________________________________________________________

Maple [B]  time = 0.093, size = 7318, normalized size = 15.5 \[ \text{output too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int(x^2*(g*x^6+f*x^4+e*x^2+d)/(c*x^4+b*x^2+a)^2,x)

[Out]

result too large to display

_______________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \[ -\frac{{\left (2 \, c^{3} d - b c^{2} e +{\left (b^{2} c - 2 \, a c^{2}\right )} f -{\left (b^{3} - 3 \, a b c\right )} g\right )} x^{3} +{\left (b c^{2} d - 2 \, a c^{2} e + a b c f -{\left (a b^{2} - 2 \, a^{2} c\right )} g\right )} x}{2 \,{\left (a b^{2} c^{2} - 4 \, a^{2} c^{3} +{\left (b^{2} c^{3} - 4 \, a c^{4}\right )} x^{4} +{\left (b^{3} c^{2} - 4 \, a b c^{3}\right )} x^{2}\right )}} + \frac{g x}{c^{2}} + \frac{\int \frac{b c^{2} d - 2 \, a c^{2} e + a b c f -{\left (2 \, c^{3} d - b c^{2} e -{\left (b^{2} c - 6 \, a c^{2}\right )} f +{\left (3 \, b^{3} - 13 \, a b c\right )} g\right )} x^{2} -{\left (3 \, a b^{2} - 10 \, a^{2} c\right )} g}{c x^{4} + b x^{2} + a}\,{d x}}{2 \,{\left (b^{2} c^{2} - 4 \, a c^{3}\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((g*x^6 + f*x^4 + e*x^2 + d)*x^2/(c*x^4 + b*x^2 + a)^2,x, algorithm="maxima")

[Out]

-1/2*((2*c^3*d - b*c^2*e + (b^2*c - 2*a*c^2)*f - (b^3 - 3*a*b*c)*g)*x^3 + (b*c^2
*d - 2*a*c^2*e + a*b*c*f - (a*b^2 - 2*a^2*c)*g)*x)/(a*b^2*c^2 - 4*a^2*c^3 + (b^2
*c^3 - 4*a*c^4)*x^4 + (b^3*c^2 - 4*a*b*c^3)*x^2) + g*x/c^2 + 1/2*integrate((b*c^
2*d - 2*a*c^2*e + a*b*c*f - (2*c^3*d - b*c^2*e - (b^2*c - 6*a*c^2)*f + (3*b^3 -
13*a*b*c)*g)*x^2 - (3*a*b^2 - 10*a^2*c)*g)/(c*x^4 + b*x^2 + a), x)/(b^2*c^2 - 4*
a*c^3)

_______________________________________________________________________________________

Fricas [F(-1)]  time = 0., size = 0, normalized size = 0. \[ \text{Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((g*x^6 + f*x^4 + e*x^2 + d)*x^2/(c*x^4 + b*x^2 + a)^2,x, algorithm="fricas")

[Out]

Timed out

_______________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \[ \text{Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(x**2*(g*x**6+f*x**4+e*x**2+d)/(c*x**4+b*x**2+a)**2,x)

[Out]

Timed out

_______________________________________________________________________________________

GIAC/XCAS [F(-2)]  time = 0., size = 0, normalized size = 0. \[ \text{Exception raised: TypeError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((g*x^6 + f*x^4 + e*x^2 + d)*x^2/(c*x^4 + b*x^2 + a)^2,x, algorithm="giac")

[Out]

Exception raised: TypeError